package com.haixiaoke.saas.repository.mapper;

import com.haixiaoke.saas.repository.dto.HousingAllocationDTO;
import com.haixiaoke.saas.repository.pojo.House;
import com.haixiaoke.saas.repository.vo.HousingAllocationVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;

/**
 * 房屋表saas_houseMapper接口
 *
 * @author haixiaoke
 * @date 2023-04-10
 */
@Mapper
public interface HouseMapper {
    /**
     * 查询房屋表saas_house
     *
     * @param id 房屋表saas_house主键
     * @return 房屋表saas_house
     */
    House selectHouseById(String id);

    /**
     * 查询房屋表saas_house列表
     *
     * @param house 房屋表saas_house
     * @return 房屋表saas_house集合
     */
    List<HousingAllocationVO> selectHouseList(HousingAllocationDTO house);

    /**
     * 新增房屋表saas_house
     *
     * @param house 房屋表saas_house
     * @return 结果
     */
    int insertHouse(House house);

    /**
     * 修改房屋表saas_house
     *
     * @param house 房屋表saas_house
     * @return 结果
     */
    int updateHouse(House house);

    /**
     * 删除房屋表saas_house
     *
     * @param id 房屋表saas_house主键
     * @return 结果
     */
    int deleteHouseById(String id);

    /**
     * 批量删除房屋表saas_house
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteHouseByIds(String[] ids);

    HashMap<String, Integer> selectCount();

    /**
     * 查询上架状态的公寓数据集
     *
     * @param house
     * @return
     */
    List<HousingAllocationVO> selectHouseListApplet(HousingAllocationDTO house);

    House selectHouseByIdAndStatus(@Param("id") String houseId, @Param("status") int status);

    List<String> getHousingInSameCommunity(@Param("residenceCommunityId") String residenceCommunityId, @Param("houseId") String houseId);

    List<House> apartmentFilter(House house);

    List<House> selectByHouseIds(List<String> houseId);
}
